package com.sanq.product.cab.basic.mvc.mapper;

import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * version: 基础Mapper
 * ---------------------
 *
 * @author sanq.Yan
 * @date 2020/1/26
 */
public interface BaseMapper<T, K> {

    int save(T save);

    int delete(T delete);

    int update(@Param("entity") T update, @Param("id") K id);

    T findById(K id);

    List<T> findList(@Param("query") T query);

    List<T> findListByPage(@Param("query") T query, @Param("startPage") int startPage, @Param("pageSize") int pageSize);

    int findCount(@Param("query") T query);

    void saveByList(@Param("saves") List<T> save);
}
